package com.lzh.controller;

import com.lzh.bean.CustomerInquiry;
import com.lzh.common.bean.PageBean;
import com.lzh.common.bean.ResultBean;
import com.lzh.common.controller.BaseController;
import com.lzh.service.InquiryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "询价单管理")
@RestController
@RequestMapping("/api")
public class InquiryController extends BaseController {

    @Autowired
    private InquiryService inquiryService;

    @ApiOperation("保存询价单")
    @PostMapping("/inquiry")
    public ResultBean saveInquiry(@RequestBody CustomerInquiry customerInquiry){
        int i = inquiryService.saveInquiry(customerInquiry);
        String tmp = i > 0 ? "保存成功":"保存失败";
        return success("保存询价单",tmp);
    }

    public ResultBean queryInquiryById(@RequestBody CustomerInquiry customerInquiry){
        return null;
    }
}
